/*************************************************************
 * File: BusinessException.java
 * Copyright (c) 2012
 * Author: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Jan 10, 2013
 * Description: 
 ************************************************************/

package snow.core.exception;

import snow.core.toolkit.format.Formatter;

/**
 * 业务异常
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com
 * @version 1.0
 */
public class BusinessException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 260412181312711343L;

	private String code;
	private String message;

	public BusinessException() {
	}

	public BusinessException(String code, String message) {
		setCode(code);
		setMessage(message);
	}

	@Formatter(serialize = false)
	public Throwable getCause() {
		return super.getCause();
	}

	public String getCode() {
		return this.code;
	}

	@Formatter(serialize = false)
	public String getLocalizedMessage() {
		return super.getLocalizedMessage();
	}

	public String getMessage() {
		return this.message;
	}

	@Formatter(serialize = false)
	public StackTraceElement[] getStackTrace() {
		return super.getStackTrace();
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
